<?php /*a:2:{s:64:"/www/wwwroot/jj.xueao400.com/application/jujin/view/ad/form.html";i:1536132443;s:71:"/www/wwwroot/jj.xueao400.com/application/admin/view/public/content.html";i:1531908558;}*/ ?>
<!-- 右则内容区域 开始 -->

<div class="layui-card">
    <!--<?php if(!(empty($title) || (($title instanceof \think\Collection || $title instanceof \think\Paginator ) && $title->isEmpty()))): ?>-->
    <div class="layui-header notselect">
        <div class="pull-left"><span><?php echo htmlentities($title); ?></span></div>
        <div class="pull-right margin-right-15 nowrap"></div>
    </div>
    <!--<?php endif; ?>-->
    <div class="layui-card-body">
<form autocomplete="off" onsubmit="return false;" action="<?php echo request()->url(); ?>" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>

    <div class="form-group">
        <label class="col-sm-2 control-label">广告名称</label>
        <div class='col-sm-8'>
            <input autofocus name="name" value='<?php echo htmlentities((isset($vo['name']) && ($vo['name'] !== '')?$vo['name']:"")); ?>' required="required" title="请输入广告名称" placeholder="请输入广告名称" class="layui-input">
        </div>
    </div>

    <!--<?php if(!empty($cates)): ?>-->
    <div class="form-group">
        <label class="col-sm-2 control-label">广告分类</label>
        <div class='col-sm-8'>
            <select required class="layui-select full-width" name="type">
                <?php foreach($cates as $cate): ?>
                <!--<?php if($cate['id'] == (isset($vo['type']) && ($vo['type'] !== '')?$vo['type']:0)): ?>-->
                <option selected="selected" value="<?php echo htmlentities($cate['id']); ?>"><?php echo htmlentities($cate['title']); ?></option>
                <!--<?php else: ?>-->
                <option value="<?php echo htmlentities($cate['id']); ?>"><?php echo htmlentities($cate['title']); ?></option>
                <!--<?php endif; ?>-->
                <?php endforeach; ?>
            </select>
        </div>
    </div>
    <!--<?php endif; ?>-->

    <div class="form-group">
        <label class="col-sm-2 control-label">跳转目标</label>
        <div class='col-sm-8'>
            <select required class="layui-select full-width" name="target">
                <?php $target = (isset($vo['target']) && ($vo['target'] !== '')?$vo['target']:''); ?>
                <option <?php echo $target=='_parent' ? 'selected' : ''; ?> value="_parent">父窗口</option>
                <option <?php echo $target=='_blank' ? 'selected' : ''; ?> value="_blank">新窗口</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label label-required">图片</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <thead>
                <tr>
                    <td>广告图片</td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-top" style="width:100px">
                        <input type="hidden" name="image" value="<?php echo htmlentities((isset($vo['image']) && ($vo['image'] !== '')?$vo['image']:'')); ?>">
                        <script>$('[name=image]').uploadOneImage()</script>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">广告目标</label>
        <div class='col-sm-8'>
            <input name="url" value='<?php echo htmlentities((isset($vo['url']) && ($vo['url'] !== '')?$vo['url']:"")); ?>'  title="请输入广告目标" placeholder="请输入广告目标" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">排序</label>
        <div class='col-sm-8'>
            <input name="sort" value='<?php echo htmlentities((isset($vo['sort']) && ($vo['sort'] !== '')?$vo['sort']:"0")); ?>'  title="请输入排序值" placeholder="请输入排序值" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">备注</label>
        <div class='col-sm-8'>
            <textarea placeholder="请输入描述" title="请输入描述" class="layui-textarea" name="remark"><?php echo htmlentities((isset($vo['remark']) && ($vo['remark'] !== '')?$vo['remark']:"")); ?></textarea>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            <?php if(!empty($vo['id'])): ?><input type="hidden" name="id" value="<?php echo htmlentities($vo['id']); ?>"><?php endif; ?>
            <button class="layui-btn" type="submit">保存</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消</button>
        </div>
    </div>

    <script>window.form.render();</script>

    <style>
        .background-item {
            padding: 15px;
            background: #efefef;
        }

        .background-item thead tr {
            background: #e0e0e0
        }
    </style>
</form>
</div>
</div>

<!-- 右则内容区域 结束 -->